import random
from threading import Thread
from time import sleep


class reference_int:
    def __init__(self):
        self.randomNum = 0


class load_num(Thread):
    # 把对象传进去
    def __init__(self, ri:reference_int):
        super().__init__()
        self.i=ri

    def run(self):
        self.plane()

    def plane(self):
        while True:
            self.i.randomNum=random.randint(1,10)
            sleep(0.5)

